#include <iostream>
#include <functional>
#include <vector>
#include <algorithm>
using namespace std;

int main()
{
    vector<int> a{1, 2, 3, 4, 5};
    for_each(a.begin(), a.end(), [](int x) { cout << x << "\t"; });
    cout << "\n";
    for_each(a.begin(), a.end(), [](int x) { cout << ++x << "\t"; });
    cout << "\n";

    vector<int> b(7,0);
    copy(a.begin(), a.end(), b.begin());
    for_each(b.begin(), b.end(), [](int x) { cout << x << "\t"; });
    cout << "\n";
    return 0;
}
